﻿using Abp.Application.Services;
using Abp.Domain.Repositories;
using JHT.SimpleTaskSystem.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JHT.SimpleTaskSystem
{
    public class PersonAppService : CrudAppService<Person, PersonDto>, IPersonAppService
    {
        public PersonAppService(IRepository<Person, int> repository) : base(repository)
        {
        }

        public GetAllPeopleOutput GetAllPeople()
        {
            GetAllPeopleOutput getAllPeopleOutput = new GetAllPeopleOutput();
            getAllPeopleOutput.People = AutoMapper.Mapper.Map<List<PersonDto>>(this.Repository.GetAll());
            return getAllPeopleOutput;
        }
    }
}
